"""This script uses msgfmt.py to generate MO files from PO files, and put 
different MO files into different folders.
"""

import os
import i18n
from py2po import languages

if __name__ == '__main__':
    for language in languages:
        cmd = "".join(['python msgfmt.py -o ', i18n.localedir, '/', language, 
                       '/LC_MESSAGES/', i18n.domain, '.mo ', i18n.domain, 
                       '_', language, '.po'])
        os.system(cmd)
        print 'Execute command:', cmd